package util;

import static util.PropertiesReader.*;
import static util.ProjectUtil.*;
import static util.FileUtil.*;

public class Properties {

    public interface Prop {
    }

    public enum Dirs implements Prop {
        mainJavaDir,
        mainResourcesDir,
        testJavaDir,
        testResourcesDir,
        webappDir,
        webInfDir,
        stylesDir,
        metaInfDir,
        libDir,
        srcGenPath,
        targetClasses,
        targetTestClasses;
    }

    public enum Packages implements Prop {
        modelPackage,
        modelBasePackage,
        basePagesPackage,
        pagesPackage,
        componentsPackage,
        servicesPackage,
        serverBasePackage,
        serverPackage;
    }

    public enum Templates implements Prop {
        templateToStringLine,
        templateSetter,
        templateGetter,
        templateSetterForList,
        templateGetterForList,
        templateLogger,
        templateLoggerCall,
        templateFacadeCall,
        templateFacadeCallWithParam,
        templateField,
        templateFieldForList,
        templateConstructor;

        public String getValue(String... arg) {

            String propertyValue = get(toString());

            if (propertyValue.equals("#file"))
                return getFormated(readFile("java/" + toString()), arg);

            return getFormated(propertyValue, arg);
        }
    }
}
